package org.dtrd.modules.record.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.dtrd.config.system.Constant;
import org.dtrd.config.system.Constant.InsulinRecordType;

/**
 * 日常检测常量
 *
 * @author xiao
 * @date 2022/7/26 4:13 PM
 */
public final class RecordConstant {

    private RecordConstant() {
    }

    /**
     * 胰岛素注射情况
     *
     * @author xiao
     * @since 2022-07-26 16:15:11
     */
    @AllArgsConstructor
    @Getter
    public enum InsulinInjection {
        /**
         * 1-遵嘱注射 2-漏注射 3-自停打
         */
        INJECTION(1, "遵嘱注射"),

        LEAKYINJECTION(2, "漏注射"),

        STOPINJECTION(3, "自停打");

        private int type;
        private String name;

        public static InsulinInjection valueOf(Integer type) {
            for (InsulinInjection value : values()) {
                if (value.type == type) {
                    return value;
                }
            }
            return null;
        }
    }

}
